y <- iris[, 1]
x <- iris[, 2:4]
x <- x/ sqrt( rowSums(x^2) ) ## Euclidean response and spherical predictors
knnreg.tune(y, x, A = 5, res = "eucl", estim = "arithmetic")
y <- iris[, 1:3]
y <- y/ sqrt( rowSums(y^2) ) ## Spherical response and Euclidean predictor
x <- iris[, 2]
knnreg.tune(y, x, A = 5, res = "spher", estim = "arithmetic")
Run the code above in your browser using DataLab